package de.playmee.enums;

public enum TimeOfDay {
		
	Morning,
	Forenoon,
	Noon,
	Afternoon,
	Evening,
	Night;
	
	/**
	 * returns the current time of day
	 * MORNING: 6:00 - 10:00
	 * FORENOON: 10:00 - 12:00
	 * NOON: 12:00 - 14:00
	 * AFTERNOON: 14:00 - 18:00
	 * EVENING: 18:00 - 22:00
	 * NIGHT: 22:00 - 06:00
	 * 
	 * @param date
	 * @return TimeOfDay
	 */
	public static TimeOfDay get(int hours) {
		if (hours >= 6 && hours < 10) {
			return Morning;
		} else if (hours >= 10 && hours < 12) {
			return Forenoon;
		} else if (hours >= 12 && hours < 14) {
			return Noon;
		} else if (hours >= 14 && hours < 18) {
			return Afternoon;
		} else if (hours >= 18 && hours < 22) {
			return Evening;
		} else {
			return Night;
		}
	}
	
	/**
	 * returns an array with all times of day
	 * needed for editing channel and track settings
	 * 
	 * @return array
	 */
	public static String[] getStringList() {
		String[] timesOfDay = new String[6];
		timesOfDay[0] = Morning.toString();
		timesOfDay[1] = Forenoon.toString();
		timesOfDay[2] = Noon.toString();
		timesOfDay[3] = Afternoon.toString();
		timesOfDay[4] = Evening.toString();
		timesOfDay[5] = Night.toString();
		return timesOfDay;
	}
}
